package ms.maplestory.boot.enums;

import java.util.Arrays;

/**
 * 角色基本属性掩码
 */
public enum CharStatFlag {

    skin(0x1),
    face(0x2),
    hair(0x4),
    level(0x10),
    subJob(0x20),
    str(0x40),
    dex(0x80),
    int_(0x100),
    luk(0x200),
    hp(0x400),
    mhp(0x800),
    mp(0x1000),
    mmp(0x2000),
    ap(0x4000),
    sp(0x8000),
    exp(0x10000),
    pop(0x20000),
    money(0x40000);

    private int value;

    CharStatFlag(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public static CharStatFlag getByValue(int stat) {
        return Arrays.stream(values()).filter(s -> s.getValue() == stat).findFirst().orElse(null);
    }
}
